

const deail = {
    namespaced: true,
    state: {
        user: [],
        id:''
    },
    getters: {},
    mutations: {
       setuser(state,arr){
		   state.user=arr
		   state.id=arr[0].id
		   // console.log(state.user)
	   }
    },
    actions: {
         getuser({commit},obj){
           uni.request({
           	url: 'http://localhost:3030/user/login',
			method: "post",
			header: {
				"Content-type": "application/x-www-form-urlencoded;charset=utf-8"
			},
           	data: 
           		obj
           	,
           	success: (res) => {
				console.log(res.data)
           		commit("setuser",res.data.data)
				uni.setStorage({
					key: 'zxwx020430',
					data: JSON.stringify(res.data.data),
					success: (res) => {
						console.log("保存成功")
					},
				})
           	}
           });
        }
       
    },
}
export default deail